<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
<meta name="viewport"
      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">

    <meta name="author" content="kissdata">


    <meta name="subtitle" content="人生笔记">


    <meta name="description" content="南邮计算机学院2021毕业生王鹏的介绍，cs软件工程专业">


    <meta name="keywords" content="wangpeng 王鹏 南邮 南京">


<title>这个博客主题的更新操作 | 王鹏的小岛</title>



    <link rel="icon" href="/myIcon.ico">




    <!-- stylesheets list from _config.yml -->
    
    <link rel="stylesheet" href="/css/style.css">
    



    <!-- scripts list from _config.yml -->
    
    <script src="/js/script.js"></script>
    
    <script src="/js/tocbot.min.js"></script>
    



    
    
        <!-- MathJax配置，可通过单美元符号书写行内公式等 -->
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
    "HTML-CSS": {
        preferredFont: "TeX",
        availableFonts: ["STIX","TeX"],
        linebreaks: { automatic:true },
        EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50)
    },
    tex2jax: {
        inlineMath: [ ["$", "$"], ["\\(","\\)"] ],
        processEscapes: true,
        ignoreClass: "tex2jax_ignore|dno",
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    },
    TeX: {
        equationNumbers: { autoNumber: "AMS" },
        noUndefined: { attributes: { mathcolor: "red", mathbackground: "#FFEEEE", mathsize: "90%" } },
        Macros: { href: "{}" }
    },
    messageStyle: "none"
    });
</script>
<!-- 给MathJax元素添加has-jax class -->
<script type="text/x-mathjax-config">
    MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for(i=0; i < all.length; i += 1) {
            all[i].SourceElement().parentNode.className += ' has-jax';
        }
    });
</script>
<!-- 通过连接CDN加载MathJax的js代码 -->
<script type="text/javascript" async
        src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML">
</script>


    


<meta name="generator" content="Hexo 7.0.0"></head>

<body>
    <script>
        // this function is used to check current theme before page loaded.
        (() => {
            const currentTheme = window.localStorage && window.localStorage.getItem('theme') || '';
            const isDark = currentTheme === 'dark';
            const pagebody = document.getElementsByTagName('body')[0]
            if (isDark) {
                pagebody.classList.add('dark-theme');
                // mobile
                document.getElementById("mobile-toggle-theme").innerText = "· Dark"
            } else {
                pagebody.classList.remove('dark-theme');
                // mobile
                document.getElementById("mobile-toggle-theme").innerText = "· Light"
            }
        })();
    </script>

    <div class="wrapper">
        <header>
    <nav class="navbar">
        <div class="container">
            <div class="navbar-header header-logo"><a href="/">侠之大者</a></div>
            <div class="menu navbar-right">
                
                    <a class="menu-item" href="/update/mystate">Career</a>
                
                    <a class="menu-item" href="/category">Legend</a>
                
                    <a class="menu-item" href="/about">Me</a>
                
                <input id="switch_default" type="checkbox" class="switch_default">
                <label for="switch_default" class="toggleBtn"></label>
            </div>
        </div>
    </nav>

    
    <nav class="navbar-mobile" id="nav-mobile">
        <div class="container">
            <div class="navbar-header">
                <div>
                    <a href="/">侠之大者</a><a id="mobile-toggle-theme">·&nbsp;Light</a>
                </div>
                <div class="menu-toggle" onclick="mobileBtn()">&#9776; Menu</div>
            </div>
            <div class="menu" id="mobile-menu">
                
                    <a class="menu-item" href="/update/mystate">Career</a>
                
                    <a class="menu-item" href="/category">Legend</a>
                
                    <a class="menu-item" href="/about">Me</a>
                
            </div>
        </div>
    </nav>

</header>
<script>
    var mobileBtn = function f() {
        var toggleMenu = document.getElementsByClassName("menu-toggle")[0];
        var mobileMenu = document.getElementById("mobile-menu");
        if(toggleMenu.classList.contains("active")){
           toggleMenu.classList.remove("active")
            mobileMenu.classList.remove("active")
        }else{
            toggleMenu.classList.add("active")
            mobileMenu.classList.add("active")
        }
    }
</script>
            <div class="main">
                <div class="container">
    
    
        <div class="post-toc">
    <div class="tocbot-list">
    </div>
    <div class="tocbot-list-menu">
        <a class="tocbot-toc-expand" onclick="expand_toc()">Expand all</a>
        <a onclick="go_top()">Back to top</a>
        <a onclick="go_bottom()">Go to bottom</a>
    </div>
</div>

<script>
    var tocbot_timer;
    var DEPTH_MAX = 6; // 为 6 时展开所有
    var tocbot_default_config = {
        tocSelector: '.tocbot-list',
        contentSelector: '.post-content',
        headingSelector: 'h1, h2, h3, h4, h5',
        orderedList: false,
        scrollSmooth: true,
        onClick: extend_click,
    };

    function extend_click() {
        clearTimeout(tocbot_timer);
        tocbot_timer = setTimeout(function() {
            tocbot.refresh(obj_merge(tocbot_default_config, {
                hasInnerContainers: true
            }));
        }, 420); // 这个值是由 tocbot 源码里定义的 scrollSmoothDuration 得来的
    }

    document.ready(function() {
        tocbot.init(obj_merge(tocbot_default_config, {
            collapseDepth: 1
        }));
    });

    function expand_toc() {
        var b = document.querySelector('.tocbot-toc-expand');
        var expanded = b.getAttribute('data-expanded');
        expanded ? b.removeAttribute('data-expanded') : b.setAttribute('data-expanded', true);
        tocbot.refresh(obj_merge(tocbot_default_config, {
            collapseDepth: expanded ? 1 : DEPTH_MAX
        }));
        b.innerText = expanded ? 'Expand all' : 'Collapse all';
    }

    function go_top() {
        window.scrollTo(0, 0);
    }

    function go_bottom() {
        window.scrollTo(0, document.body.scrollHeight);
    }

    function obj_merge(target, source) {
        for (var item in source) {
            if (source.hasOwnProperty(item)) {
                target[item] = source[item];
            }
        }
        return target;
    }
</script>
    

    
    <article class="post-wrap">
        <header class="post-header">
            <h1 class="post-title">这个博客主题的更新操作</h1>
            
                <div class="post-meta">
                    
                        Author: <a itemprop="author" rel="author" href="/">kissdata</a>
                    

                    
                        <span class="post-time">
                        Date: <a href="#">Nov 22, 2023&nbsp;&nbsp;16:07</a>
                        </span>
                    
                    
                        <span class="post-category">
                    Category:
                            
                                <a href="/categories/Review/">Review</a>
                            
                        </span>
                    
                </div>
            
        </header>

        <div class="post-content">
            <p>更新主题后修改</p>
<h3 id="一、layout目录"><a href="#一、layout目录" class="headerlink" title="一、layout目录"></a>一、layout目录</h3><p>在 <code>page</code> 目录下，去除 <code>post.ejs</code> 文件中的 关于左下角 tag 的代码。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">&lt;div&gt; </span><br><span class="line">    &lt;!-- 以下删除 --&gt;</span><br><span class="line">    &lt;span&gt;Tag(s):&lt;/span&gt;</span><br><span class="line">    &lt;span class=&quot;tag&quot;&gt;</span><br><span class="line">        &lt;% if(page.tags.length!==0)&#123;%&gt;</span><br><span class="line">        &lt;% page.tags.forEach(item=&gt;&#123; %&gt;</span><br><span class="line">        &lt;a href=&quot;&lt;%- url_for(item.path) %&gt;&quot;&gt;# &lt;%- item.name %&gt;&lt;/a&gt;</span><br><span class="line">        &lt;% &#125;) %&gt;</span><br><span class="line">        &lt;% &#125; %&gt;</span><br><span class="line">    &lt;/span&gt;</span><br><span class="line">    &lt;!-- 以上删除 --&gt;</span><br><span class="line">&lt;/div&gt;</span><br></pre></td></tr></table></figure>

<p>在 <code>partial</code> 目录下，更改 <code>footer.ejs</code> 文件中的关于页脚的代码。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&lt;div class=&quot;copyright&quot;&gt;</span><br><span class="line">    &lt;span&gt;187-9597-5517 &amp;ensp; 王鹏 © &lt;a href=&quot;https://cs.njupt.edu.cn/&quot; target=&quot;_blank&quot;&gt;njupt&lt;/a&gt;&lt;/span&gt;   </span><br><span class="line">&lt;/div&gt;</span><br></pre></td></tr></table></figure>

<p>修改 category.ejs 将每次显示文章数超量显示more从超过5行 换成 超过9行</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&lt;% if(++index &lt;= 9)&#123; %&gt;</span><br><span class="line">......</span><br><span class="line">&lt;% if(category_item.posts.length &gt; 9)&#123; %&gt;</span><br><span class="line">&lt;a class=&quot;more-post-link&quot; href=&quot;&lt;%- url_for(category_item.path) %&gt;&quot;&gt;More &gt;&gt;</span><br><span class="line">&lt;/a&gt;</span><br><span class="line">&lt;% &#125; %&gt;</span><br></pre></td></tr></table></figure>

<h2 id="二、source目录"><a href="#二、source目录" class="headerlink" title="二、source目录"></a>二、source目录</h2><ol>
<li>CSS增加图标</li>
</ol>
<p><code>style.styl</code> 增加一行 <code>@import &quot;../fonts/font_selfuse/iconfont.css&quot;</code></p>
<p>在 <code>..\source\fonts</code> 增加下载的新logo字体包（需要查下怎么弄）</p>
<ol start="2">
<li>替换 <code>image</code> 目录的头像，换成自己的图，图像名不变。</li>
<li>替换浏览器打开时显示的 <code>xxx.ico</code></li>
</ol>
<h2 id="三、增加-category目录"><a href="#三、增加-category目录" class="headerlink" title="三、增加 category目录"></a>三、增加 category目录</h2><p>要修改 index，增加一行 <code>layout</code> 否则分类页面不显示。</p>
<figure class="highlight makefile"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">title: category  # 自动出现</span></span><br><span class="line"><span class="section">date: .. # 自动出现</span></span><br><span class="line"><span class="section">layout: category</span></span><br></pre></td></tr></table></figure>

<h2 id="写时注意"><a href="#写时注意" class="headerlink" title="写时注意"></a>写时注意</h2><p>图片连接两种方式</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">img</span> <span class="attr">src</span>=<span class="string">&quot;save_err1.png&quot;</span>&gt;</span></span><br><span class="line">![](save_err1.png)</span><br></pre></td></tr></table></figure>

<p>第一种，需要图片所在文件夹和文档同在一个目录。第2种md语法，需要把图片放在image目录，然后从根站点开始写路径。比如 <code>../image/filename/xxx.png</code></p>
<h2 id="目录问题"><a href="#目录问题" class="headerlink" title="目录问题"></a>目录问题</h2><p>md上的toc在blog上是不可见的，如果加密的情况下，右侧的导航栏也不显示。或者显示太全，只是想实现自己的页内几个地方的跳转，需要手动加目录。</p>
<p>增加方式，链接后面加 <code>#titlename</code> ，或者 <code>&lt;a href=&quot;#titlename&quot;&gt;title&lt;/a&gt;</code> 。</p>

        </div>

        
            <section class="post-copyright">
                
                
                
                
                     <p class="copyright-item">
                         <span>Slogan:</span>
                         <span>人生三大错觉：我躲得过去，我能反杀，是不是<strong>喜欢我?</strong></span>
                     </p>
                

            </section>
        
        <section class="post-tags">
            <div>
            </div>
            <div>
                <a href="javascript:window.history.back();">back</a>
                <span>· </span>
                <a href="/">home</a>
            </div>
        </section>
        <section class="post-nav">
            
                <a class="prev" rel="prev" href="/2023/11-22/review_vcpp/">第一次工作总结 | VC++</a>
            
            
            <a class="next" rel="next" href="/2023/11-22/ability_english/">英语能力</a>
            
        </section>


    </article>
</div>

            </div>
            <footer id="footer" class="footer">
    <div class="copyright">
        <span>187-9597-5517 &nbsp; 王鹏 @ <a href="https://cs.njupt.edu.cn/" target="_blank">njupt</a</span>
    </div>
</footer>

    </div>
</body>

</html>